import request from '@/config/axios'

// 用户搜索记录 VO
export interface UserHistorySearchVO {
  id: number // 编号
  userId: number // 用户编号
  content: string // 搜索内容
  userName: string
}

// 用户搜索记录 API
export const UserHistorySearchApi = {
  // 查询用户搜索记录分页
  getUserHistorySearchPage: async (params: any) => {
    return await request.get({ url: `/blog/user-history-search/page`, params })
  },

  // 查询用户搜索记录详情
  getUserHistorySearch: async (id: number) => {
    return await request.get({ url: `/blog/user-history-search/get?id=` + id })
  },

  // 新增用户搜索记录
  createUserHistorySearch: async (data: UserHistorySearchVO) => {
    return await request.post({ url: `/blog/user-history-search/create`, data })
  },

  // 修改用户搜索记录
  updateUserHistorySearch: async (data: UserHistorySearchVO) => {
    return await request.put({ url: `/blog/user-history-search/update`, data })
  },

  // 删除用户搜索记录
  deleteUserHistorySearch: async (id: number) => {
    return await request.delete({ url: `/blog/user-history-search/delete?id=` + id })
  },

  // 导出用户搜索记录 Excel
  exportUserHistorySearch: async (params) => {
    return await request.download({ url: `/blog/user-history-search/export-excel`, params })
  },
}
